package pl.easyshop.core.services.security;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

/**
 * Authorized user data. This class extends standard {@link User} class from
 * Spring Security Framework.
 * 
 * @author pwitkowski
 */
public class AuthorizedUser extends User {

	/** Unique serialization identifier. */
	private static final long serialVersionUID = -2953222010560728357L;

	/**
	 * Authorized users identifier
	 */
	private Long userId;

	/**
	 * Constructor. Details in {@link User} class.
	 */
	public AuthorizedUser(String username, String password, boolean enabled,
			boolean accountNonExpired, boolean credentialsNonExpired,
			boolean accountNonLocked,
			Collection<? extends GrantedAuthority> authorities) {
		super(username, password, enabled, accountNonExpired,
				credentialsNonExpired, accountNonLocked, authorities);

	}

	/**
	 * Get userId property value.
	 * @return the userId
	 */
	public Long getUserId() {
		return userId;
	}

	/**
	 * Set userId property value.
	 * @param userId the userId to set
	 */
	public void setUserId(Long userId) {
		this.userId = userId;
	}

}
